<template>
  <view class="wrapper">
    <view class="basic">
      <view class="title"> 基本信息</view>
      <view class="listContainer">
        <view class="list">
          <view class="type">姓名</view>
          <view class="detail"> {{ checkInInfo.name }} </view>
        </view>
        <view class="list">
          <view class="type">证件类型</view>
          <view class="detail">{{ checkInInfo.cardType | cardTypeFilter }}</view>
        </view>
        <view class="list">
          <view class="type">证件号码</view>
          <view class="detail"> {{ checkInInfo.cardId || "" }} </view>
        </view>
        <view class="list no-border">
          <view class="type">电话号码</view>
          <view class="detail"> {{ checkInInfo.telPhone }} </view>
        </view>
      </view>
    </view>
    <view class="basic check-info">
      <view class="title"> 入住信息</view>
      <view class="listContainer">
        <view class="list">
          <view class="type">人员类型</view>
          <view class="detail"> {{ movePersonType }} </view>
        </view>
        <view class="list">
          <view class="type">隔离天数</view>
          <view class="detail">{{ checkInInfo.moveDay }}</view>
        </view>
        <view class="list">
          <view class="type">房间选择</view>
          <view class="detail"> {{ checkInInfo.roomNum || "" }} </view>
        </view>
        <view class="list no-border">
          <view class="type">入住时间</view>
          <view class="detail"> {{ checkInInfo.moveStartTime || "" }} </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import { cardTypes } from "@/data";
export default {
  data() {
    return {
      personTypeList: [],
      movePersonType: '',
      checkInInfo: {}, // 隔离信息
    };
  },
  filters: { 
    cardTypeFilter(value) {
      const typeObj = cardTypes.find(obj => obj.value === value);
      return typeObj ? typeObj.label : '';
    }
  },
  async onLoad(option) {
    this.personTypeList = await this.$store.dispatch('getDic','person_classify')
    const item = JSON.parse(decodeURIComponent(option.item));
    // 查询人员类型
    if(item && item.personInfo && item.personInfo.personClassify) {
      const typeObj = this.personTypeList.find(obj => obj.value == item.personInfo.personClassify);
      this.movePersonType = typeObj ? typeObj.label : '-';
    }
    // console.log('onLoad====',this.personTypeList, item);
    // console.log('item.personInfo====',item.personInfo);
    this.checkInInfo = item.personInfo;
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.wrapper {
  background-color: #f9f9f9;
  .title {
    height: 98rpx;
    line-height: 98rpx;
    font-size: 40rpx;
    padding: 0 32rpx;
    background-color: #fff;
    border-bottom: 1rpx solid #e5e5e5;
  }
}
// 基本信息
.basic {
  background-color: #fff;

  .listContainer {
    padding: 0 32rpx;
  }
  .list {
    height: 100rpx;
    // height: 74rpx;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 0.5px solid #e5e5e5;
  }
  .no-border {
    border-bottom: none;
  }
  .type {
    font-size: 30rpx;
    font-family: PingFang SC;
    color: #999999;
    opacity: 1;
  }
  .detail {
    font-size: 34rpx;
    font-family: PingFang SC;
    color: #666666;
    opacity: 1;
  }
}
.check-info{
  margin-top: 40rpx;
}
</style>
